import requests

from lxml import etree

url = "https://cang.cngold.org/c/2022-06-14/c8152503.html"


headers = {
    'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1 Edg/131.0.0.0'
}

response = requests.get(url, headers=headers)

data = response.content.decode()

# 解析数据
tree = etree.HTML(data)

table = tree.xpath('//table[@border="1"]')[0]
trs = table.xpath('./tbody/tr')

for tr in trs:
    td1 = tr.xpath('./td[1]/text()')
    td2 = tr.xpath('./td[2]/text()')
    td3 = tr.xpath('./td[3]/text()')
    print(td1[0], td2[0], td3[0])